package com.kingyun.gpsinspection.purificationservice.facade.service.jsm.permission;

import com.kingyun.gpsinspection.purificationservice.facade.model.jsm.AccountRole;
import com.kingyun.gpsinspection.purificationservice.facade.model.jsm.EmployeeVo;
import com.kingyun.gpsinspection.purificationservice.facade.model.jsm.Menu;

import java.util.List;

/**
 * Created by huangxueqian on 2017/1/6/006.
 * 创建权限服务，获取子系统服务
 */
public interface JsmPermissionService {

    /**
     * 获取登录子系统的一级菜单
     *
     * @param systemCode 系统编码，
     * @param employeeVo 当前用户信息
     * @return
     */
    List<Menu> getFirstNavPermission(String systemCode, EmployeeVo employeeVo, String pfToken) throws Exception;

    /**
     * @param systemCode 当前用户信息
     * @param menuId     根据一级菜单ID， 获取对应菜单权限
     * @return 返回一级菜单的二级菜单及其子菜单
     * @throws Exception
     */
    List<Menu> getLeftMenuNavPermission(String systemCode, EmployeeVo employeeVo, String menuId, String pfToken) throws Exception;

    /**
     * 根据当前人员信息-获取所有的菜单信息
     */
    List<Menu> getAllMenuPermission(String pfToken, String systemCode, EmployeeVo employeeVo) throws Exception;

    boolean isAdmin(List<AccountRole> accountRoles);

    List<Menu> getAllMenu(String pToken, EmployeeVo employeeVo, boolean isAdmin);

    /**
     * 判断当前菜单是否该按钮是否可用
     *
     * @throws Exception
     */
    boolean isBtnPermission(String btnCode, String menuId, EmployeeVo employeeVo) throws Exception;

    /**
     * 调用复制进行url链接控制
     */
    boolean isBtnPermission(String requestUrl, String pfToken, String systemCode, EmployeeVo employeeVo) throws Exception;
}
